#ifndef ACTIVESERVICEMANAGER_H
#define ACTIVESERVICEMANAGER_H

#include <QMutex>
#include <QMutexLocker>
#include <QMap>

class Service;

class ActiveServiceManager
{
public:
    static ActiveServiceManager *getInstance()
    {
        QMutexLocker locker(&m_mutex);

        if(m_instance == 0)
        {
            m_instance = new ActiveServiceManager();
        }
        return m_instance;
    }

    ActiveServiceManager();

    ~ActiveServiceManager();

    int addRunningService( Service *service);

    int removeRunningService( std::string service_name);

    Service *getServiceByName( std::string service_name);

    bool hasRunningService();

private:

    static QMutex m_mutex;

    static ActiveServiceManager *m_instance;

    QMap< std::string, Service*> *m_activeServiceList;
};

#endif

